﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Printing.DataGridViewPrint;
using System.Drawing;

namespace Riel_Gestion.printer
{
    class ReportHeader : PrintBlock
    {
        float imgHeight = 80;

        public override System.Drawing.SizeF GetSize(System.Drawing.Graphics g, DocumentMetrics metrics)
        {
            return new SizeF(metrics.PrintAbleWidth, imgHeight + 12); //+2 for spacing with document
        }

        public override void Draw(System.Drawing.Graphics g, Dictionary<CodeEnum, string> codes)
        {
            GraphicsUnit units = GraphicsUnit.Pixel;
            RectangleF rec = Properties.Resources.header.GetBounds(ref units);

            float scale = imgHeight / rec.Height;
            g.DrawImage(Properties.Resources.header, new RectangleF(Rectangle.X, Rectangle.Y, rec.Width * scale, imgHeight));
        }
        
    }
}
